import request from '@/config/axios'

// 快递管理 VO
export interface ExpressManagementVO {
  id: number // 主键ID
  expressSerial: string // 快递流水号
  senderEnterprise: string // 寄件企业
  receiverEnterprises: string // 收件企业
  price: number // 价格
  content: string // 快递内容
  trackingNumber: string // 运单号
  recipient: string // 收件人
  sendDate: Date // 寄件日期
  isPaid: boolean // 是否已收款（0:未收,1:已收）
}

// 快递管理 API
export const ExpressManagementApi = {
  // 查询快递管理分页
  getExpressManagementPage: async (params: any) => {
    return await request.get({ url: `/oa/express-management/page`, params })
  },

  // 查询快递管理详情
  getExpressManagement: async (id: number) => {
    return await request.get({ url: `/oa/express-management/get?id=` + id })
  },

  // 新增快递管理
  createExpressManagement: async (data: ExpressManagementVO) => {
    return await request.post({ url: `/oa/express-management/create`, data })
  },

  // 修改快递管理
  updateExpressManagement: async (data: ExpressManagementVO) => {
    return await request.put({ url: `/oa/express-management/update`, data })
  },

  // 删除快递管理
  deleteExpressManagement: async (id: number) => {
    return await request.delete({ url: `/oa/express-management/delete?id=` + id })
  },

  // 导出快递管理 Excel
  exportExpressManagement: async (params) => {
    return await request.download({ url: `/oa/express-management/export-excel`, params })
  }
}